package com.example.springdemo.domain.table;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.springdemo.enums.Sex;
import com.example.springdemo.enums.Status;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * User
 * 用户表
 *
 * @author : wenguang
 * @date : 2021/11/15 17:56
 */
@ApiModel(description = "用户表")
@Data
@TableName(value = "t_user")
public class User implements Serializable {

    /**
     * id,主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "id,主键")
    private Integer id;

    /**
     * 用户名
     */
    @TableField(value = "user_name")
    @ApiModelProperty(value = "用户名")
    private String userName;

    /**
     * 登陆密码
     */
    @TableField(value = "`password`")
    @ApiModelProperty(value = "登陆密码")
    private String password;

    /**
     * 性别(0-女，1-男，2-保密)
     */
    @TableField(value = "sex")
    @ApiModelProperty(value = "性别(0-女，1-男，2-保密)")
    private Sex sex;

    /**
     * 生日
     */
    @TableField(value = "birthday")
    @ApiModelProperty(value = "生日")
    private LocalDate birthday;

    /**
     * 邮箱
     */
    @TableField(value = "email")
    @ApiModelProperty(value = "邮箱")
    private String email;

    /**
     * 手机号
     */
    @TableField(value = "mobile")
    @ApiModelProperty(value = "手机号")
    private String mobile;

    /**
     * 位置，省
     */
    @TableField(value = "province")
    @ApiModelProperty(value = "位置，省")
    private String province;

    /**
     * 位置，市
     */
    @TableField(value = "city")
    @ApiModelProperty(value = "位置，市")
    private String city;

    /**
     * 位置，县
     */
    @TableField(value = "district")
    @ApiModelProperty(value = "位置，县")
    private String district;

    /**
     * 状态 1：正常，0：删除
     */
    @TableField(value = "`status`", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "状态 1：正常，0：删除")
    private Status status;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE, update = "now()")
    @ApiModelProperty(value = "修改时间")
    private LocalDateTime updateTime;

    private static final long serialVersionUID = 8627753290331096157L;

    public static final String COL_ID = "id";

    public static final String COL_USER_NAME = "user_name";

    public static final String COL_PASSWORD = "password";

    public static final String COL_SEX = "sex";

    public static final String COL_BIRTHDAY = "birthday";

    public static final String COL_EMAIL = "email";

    public static final String COL_MOBILE = "mobile";

    public static final String COL_PROVINCE = "province";

    public static final String COL_CITY = "city";

    public static final String COL_DISTRICT = "district";

    public static final String COL_STATUS = "status";

    public static final String COL_CREATE_TIME = "create_time";

    public static final String COL_UPDATE_TIME = "update_time";

}
